package Media.impl;

import CD.services.CompactDisc;
import Media.services.MediaPlayer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

@Component
//@PropertySource({"classpath:/resources/app.properties"})
public class CDPlayer implements MediaPlayer {

    private CompactDisc cd;

    @Autowired(required = false)
    public CDPlayer(CompactDisc cd) {
        this.cd = cd;
    }


//    @Autowired
//    private Environment environment;
//
//    @Value("disc.artist")
//    private String artist;

    @Override
    public void play() {
//        environment.getProperty("disc.title", "asd");
        cd.play();
    }
}
